<?php session_start();
if (!empty($_SESSION[uid])) {
    unset($_SESSION[uid]);
    session_destroy();
    header("Location: login.php");
}
?>